package joapp

import (
	"gitee.com/jolib/jokode"
	"gitee.com/jolib/jokode/jofile"
	"sync"
)

const (
	srcCodeCheckFilePath = "main/main.go"
	srcCodeCheckFileName = "main.go"
)

var (
	globalWaiterInstance *sync.WaitGroup
)

func init() {
	globalWaiterInstance = &sync.WaitGroup{}
}

func chkRunModeDef() jokode.RunMode {
	if jofile.FileExists(srcCodeCheckFilePath) {
		return jokode.RunModeDev
	}

	if _, got := jofile.CheckFilePathUpward(srcCodeCheckFileName); got {
		return jokode.RunModeDev
	}

	return jokode.RunModeProd
}
